﻿//==============================================================================
// File: IRcpStatusMonitor.cs
// Created: 2010-06-07
// Author: Piotr Włodek, Arkadiusz Świerczek
//==============================================================================
// This file is a part of MAMMOTH project.
// Copyright (C) 2010 AGH University of Science and Technology, Krakow.
// https://caribou.iisg.agh.edu.pl/trac/mammoth
//
// Mammoth is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// Mammoth is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with Mammoth. If not, see http://www.gnu.org/licenses/.
//==============================================================================

using System.Collections.Generic;

namespace WpfRcp.Core.Services.Status
{
    /// <summary>
    /// Provides funtionality of reporting progress of operation in deterministic manner.
    /// </summary>
    public interface IRcpStatusMonitor : ISimpleRcpStatusMonitor
    {
        /// <summary>
        /// Begins new task with declared number of steps to do.
        /// </summary>
        /// <param name="totalWork">Total work to do.</param>
        void BeginTask(double totalWork);

        /// <summary>
        /// Reports work done to status monitor. Total summary of reported work in task should be equal to TotalWork.
        /// </summary>
        /// <param name="work">Amount of work done in last computation step.</param>
        void Worked(double work);

        /// <summary>
        /// Creates subtask monitor, whose TotalWork will be scaled to totalSubWork declared in this method.
        /// </summary>
        /// <param name="totalSubWork">Amount of work units to allocate for subtask monitor.</param>
        /// <returns>New subtask status monitor.</returns>
        IRcpStatusMonitor NewSubtaskMonitor(double totalSubWork);

        /// <summary>
        /// Total work to do in current status monitor.
        /// </summary>
        double TotalWork { get; }

        /// <summary>
        /// Current amount of work done in status monitor.
        /// </summary>
        double WorkDone { get; }

        /// <summary>
        /// Collection of subtask monitors.
        /// </summary>
        IEnumerable<IRcpStatusMonitor> SubtaskMonitors { get; }
    }
}